﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace ArisanNgocok
{
   using Models;
   using Provider;

   [ServiceContract]
   public class Service 
   {
      private readonly ServiceManager _cls;

      public Service()
      {
         _cls = new ServiceManager();
      }

      [OperationContract]
      public IEnumerable<User> GetUsers()
      {
         return _cls.GetUsers();
      }

      [OperationContract]
      public void GeneratePayment(int year, int month)
      {
         _cls.GeneratePayment(year, month);
      }

      [OperationContract]
      public void UpdatePaymentStatus(Guid userId, int year, MonthEnum month, bool isPaid)
      {
         _cls.UpdatePaymentStatus(userId, year, (int) month, isPaid);
      }

      [OperationContract]
      public void UpdateUser(Guid userId, string name)
      {
         _cls.UpdateUser(userId, name);
      }

      [OperationContract]
      public void CreateUser(string name)
      {
         _cls.CreateUser(name);
      }
   }

   public enum MonthEnum
   {
      Jan = 1,
      Feb, Mar, Apr, Mei, Jun, Jul, Agu, Sep, Okt, Nov, Des
   }
}

